<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>公用的头部页面</title>

</head>
<body>
<div id="top" th:fragment="top">
    <!--头部功能条-->
    <div id="top_bar">
        <nav>
        <span>
          <a href="/admin/login_show">进入后台</a>
        </span>
            <span>|</span>
            <span>注册</span>
            <span>|</span>
            <span>登录</span>
        </nav>
    </div>
    <!--banner-->
    <div id="banner">
        <img src="/img/banner.png" alt="">
    </div>
    <!--分类菜单-->
    <div id="menu">
        <ul>
            <li><a href="/" th:class="${categoryId==null?'on':''}">首页</a></li>
            <th:block th:each="category:${categoryList}">
                <li>
                    <a th:href="@{/second(categoryId=${category.categoryId})}"
                       th:text="${category.categoryName}"
                       th:class="${categoryId==category.categoryId?'on':''}"></a>
                </li>
            </th:block>
        </ul>
    </div>
</div>
</body>
</html>